<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加街道</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->

<script type="text/javascript">
	$(function(){
		jQuery.validator.addMethod("phone", function(value, element) { var length = value.length; var mobile = /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/;var tel = /^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/; return this.optional(element) || (length == 11 && mobile.test(value))||(tel.test(value)); }, "手机号码格式错误");

	
		$("#add_street").validate({
			rules:{
				street_name:{
					required:true
				},
				store_sorts:{
					required:true
				},
				culture:{
					required:true
				}
				
			},
			messages:{
				street_name:{
					required:"街道名称不能为空！"
				},
				store_sorts:{
					required:"请选择所属区域！"
				},
				culture:{
					required:"历史文化不能为空！"
				}
			},
			errorPlacement:function(error,element){
				error.appendTo(element.siblings("div.validate_v"));
			}
		});
		
		
	})
</script>
</head>

<body>
	<!-- head -->
   <?php $this->load->view('head');?>
    <!-- head--end-->
    <?php $data['curstyle'] = 'street'?>
    <!-- body -->
    <div class="w100p mt40 mb20">
    	<div class="w903 mg">
        	<div class="box_s1">
            	<div class="b_head"></div>
                <div class="content m_pd_s1">
                	<!-- manage-top -->
                	<?php $this->load->view('member/mangtop',$data)?>
                    <!-- manage-top--end-->
                    
                    <!-- manage-det-->
                    <div class="clearfix">
                    	<div class="box_s3 fl">
                        	<div class="b_head"></div>
                        	<?php $data['leftstyle'] = 'addstreet'?>
                            <?php $this->load->view('member/streetleft',$data)?>
                            <div class="b_foot"></div>
                        </div>
                        
                        <!-- right-ope-->
                        <div class=" m_layout_s1">
                        	<div class="m_pd_s2">
                            	<div class="form_box street">
                                	<h3>添加街道</h3>
                                    <p class="tip_2">请勿上传我们已收录的街道</p>
									<form action="<?php echo site_url('member/savestreet')?>" method="post" id="add_street" enctype="multipart/form-data">
                                        <table class="com_form com_form_s1">
                                            <tbody>
                                                <tr>
                                                    <td width="99" class="col1 ">街道名称</td><td><input type="text" class="def_txt_s4" name="street_name" /><br class="clear" /><div class="validate_v" ></div></td>
                                                </tr>
                                                <tr>
                                                    <td width="99" class="col1">English name</td><td><input type="text" class="def_txt_s4" name="ename"/></td>
                                                </tr>
                                                <tr>
                                                    <td width="99" class="col1">所属区域</td>
                                                    <td>
                                                        <div class="select_wrap select_wrap_s1" style="z-index:100"><div class=" def_drop_s1 drop"><span>请选择所属区域</span></div><input type="hidden" name="store_sorts" sdataid="id1" sdatavalue="value1" /><br class="clear"><div class="validate_v"></div>
                                                            <div class="select_data_box select" style="display: none; ">
                                                            	<?php foreach ($areaList as $area):?>
                                                                <p dataid="<?php echo $area['code']?>" datavalue="<?php echo $area['code']?>"><?php echo $area['value']?></p>
                                                                <?php endforeach;?>
                                                            </div>
                                                        </div>
                                            		</td>
                                                </tr>
                                                <tr>
                                                    <td width="99" class="col1 top">历史文化</td><td><textarea class="def_ta_s1" name="culture"></textarea><br class="clear" /><div class="validate_v" ></div></td>
                                                </tr>
                                                <tr>
                                                    <td width="99" class="col1">形象图片</td><td><input type="text" class="def_txt_s4" readonly="readonly" id="logo_text"/><div class="upfile_wrap"><a href="javascript:void(0);" class="def_btn_s5 upload">browse</a><input type="file" onchange="upload_logo(this);" class="opacity_file" name="logo"/></div><span class="pic_tip">照片尺寸180x180px</span></td>
                                                </tr>
                                                <tr>
                                                    <td width="99" class="col1"></td><td><div><input type="submit" class="def_btn_s5" value="保存" /></div></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </form>
                                    
                                </div>
                            </div>
                        </div>
                        <!-- right-ope--end-->
                        
                        <div class="clear"></div>
                    </div>
                    <!-- manage-det--end-->
                    
                </div>
                <div class="b_foot"></div>
            </div>
        </div>
    </div>
    <!-- body--end-->
    
    <!-- foot-->
   <?php $this->load->view('foot')?>
    <!-- foot--end-->	
</body>
<script type="text/javascript">
	function upload_logo(obj){
		var file_name = $(obj).val();
		$("#logo_text").val(file_name);
	}
</script>
</html>
